Skip to content

Fix Jakarta EE 10 web.xml migration#1159

Merged
timtebeek merged 1 commit into
openrewrite:mainfrom
sakshichitnis27:fix/7471-jakarta-web-xml-ee10
Jul 8, 2026
Merged

Fix Jakarta EE 10 web.xml migration#1159
timtebeek merged 1 commit into
openrewrite:mainfrom
sakshichitnis27:fix/7471-jakarta-web-xml-ee10

Conversation

@sakshichitnis27

@sakshichitnis27 sakshichitnis27 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Replaces the plain text FindAndReplace steps for web.xml with XML-aware ChangeTagValue steps so web.xml remains an XML LST. This allows the later JakartaWebXml6 recipe in the JakartaEE10 chain to update web.xml from version 5.0 to 6.0.

Adds a regression test for the JakartaEE10 chain.

Verified:

  • ./gradlew test --tests "org.openrewrite.java.migrate.jakarta.JavaxWebXmlToJakartaWebXmlTest"
  • ./gradlew test --tests "org.openrewrite.java.migrate.jakarta.JakartaEE10Test"

Comment on lines +49 to +50
- org.openrewrite.FindSourceFiles:
filePattern: '**/web.xml'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might this be misplaced? As the precondition here will only match web.xml files, which means none of the ChangeDependency recipes it guards will ever match or make changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to add the precondition only to name: org.openrewrite.java.migrate.jakarta.JavaxWebXmlToJakartaWebXml ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you were right. The FindSourceFiles precondition was misplaced and was guarding UpdateJakartaFacesApi3. I moved it to only JavaxWebXmlToJakartaWebXml.

Verified:

  • UpdateJakartaFacesApiTest
  • JavaxWebXmlToJakartaWebXmlTest
  • JakartaEE10Test

@sakshichitnis27 sakshichitnis27 force-pushed the fix/7471-jakarta-web-xml-ee10 branch from 92e420e to d0b34c5 Compare July 8, 2026 10:12

@timtebeek timtebeek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks a lot for the fix here! Good to keep these files XML to allow chaining recipes.

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Jul 8, 2026
@timtebeek timtebeek merged commit 6584812 into openrewrite:main Jul 8, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

JavaxWebXmlToJakartaWebXml uses FindAndReplace which partially breaks Jakarta EE 10 migration

2 participants